<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>输入圆的半径计算面积和周长</title>
</head>
<body>
<script>
    var radius = prompt("请输入圆的半径：");

    if (radius !== null && !isNaN(radius) && radius > 0) {
      var circumference = (2 * Math.PI * radius).toFixed(2);
      var area = (Math.PI * radius * radius).toFixed(2);

      var result = "圆的半径为：" + radius + "<br>";
      result += "圆的周长为：" + circumference + "<br>";
      result += "圆的面积为：" + area;

      document.body.innerHTML += "<p>" + result + "</p>";
    } else {
      alert("请输入正确的正数作为半径！");
  }
</script>
</body>
</html>
